body {
    font-family: Arial, sans-serif;
    max-width: 1000px;
    min-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 100px);
    margin-top: 20px;
}
.chat-container {
    flex: 2;
    min-width: 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.group-list {
    width: 160px;
    min-width: 160px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.message-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}
.input-area {
    display: flex;
    gap: 10px;
    margin-top: auto;
}
textarea {
    flex: 1;
    padding: 8px;
    resize: none;
    height: 60px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    line-height: 1.5;
}
.message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 10px;
    margin-bottom: 16px;
    max-width: 100%;
    background-color: #e3f2fd;
    border-radius: 3px;
}
.message>p {
    margin: 0;
    white-space: pre-line;
}
.message-user {
    font-weight: bold;
    min-width: max-content;  /* 确保用户名不会换行 */
}
.message-time {
    color: #666;
    font-size: 0.85em;
    margin-left: 8px;
}
.message-content {
    word-break: break-word;
    max-width: 100%;
    white-space: pre-wrap;
}
.message.other {
    background-color: #f5f5f5;
    margin-right: 20px;
}
input[type="text"] {
    flex: 1;
    padding: 5px;
}
button {
    padding: 5px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
button:hover {
    background-color: #45a049;
}
.group-item {
    padding: 8px 12px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    background-color: white;
    border: 1px solid #dee2e6;
}
.group-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}
.group-item.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}
.group-list h3 {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}
.groups-scroll-container {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    max-height: calc(100vh - 250px);
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
}
.groups-scroll-container::-webkit-scrollbar {
    width: 6px;
}
.groups-scroll-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}
.groups-scroll-container::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 3px;
    border: 2px solid #f8f9fa;
}
.groups-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: #6c757d;
}
.create-group-container {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}
.group-display {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: monospace;
    height: 24px;
}
.group-prefix {
    color: #495057;
    padding: 0 2px 0 8px;
}
.group-number {
    color: #28a745;
    font-weight: bold;
    padding-left: 2px;
}
.create-group-btn {
    width: 100%;
    padding: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: bold;
}
.create-group-btn:hover {
    background-color: #218838;
}
.current-user {
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    font-size: 14px;
}
#currentUserDisplay {
    font-weight: bold;
    color: #007bff;
}
.default-group-badge {
    font-size: 12px;
    background-color: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: normal;
}
.create-group-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}
.online-users-list {
    width: 120px;
    min-width: 120px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.online-users-container {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    max-height: calc(100vh - 250px);
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
}
.online-user-item {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 5px;
    background-color: white;
    border: 1px solid #dee2e6;
}


.online-user-item:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}


.user-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #28a745; /* 绿色表示在线 */
}

.online-users-container {
    flex: 1;
    overflow-y: auto;
    min-height: 100px;
    max-height: calc(100vh - 250px);
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
}

.online-users-container::-webkit-scrollbar {
    width: 6px;
}

.online-users-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.online-users-container::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 3px;
    border: 2px solid #f8f9fa;
}
/* 未读消息标记 */
.unread-badge {
    /*display: none;*/
    background-color: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 8px;
}

.online-users-header {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 8px;
}



.user-info {
    display: inline-flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
}

.current-user .user-name {
    font-weight: bold;
    color: #007bff;
}

.system-message {
    color: #666;
    font-style: italic;
    text-align: center;
    margin: 10px 0;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 4px;
}
